home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 29 / pascal / procpass.pas < prev    next >
Pascal/Delphi Source File  |  1985-11-19  |  2KB  |  66 lines

  1. program procedurepass;
  2.  
  3.  
  4. {
  5.   PROGRAM: OSS PASCAL EXAMPLE to Demonstrate The Use of the 'superexec'
  6.            xbios call.
  7.            This program reads a variable _hz_200 (the 200hz system clock)
  8.            which is in protected memory.
  9.  
  10.   AUTHOR: John D. Hays, Redmond, Washington
  11.           CIS:       72725,424
  12.           UUCP:      uw-beaver!uw-june!bcsaic!apcisea!hays [BEST WAY]
  13.           Genie:     kd7uw
  14.           W0RLInet:  kd7uw @ wb7dch
  15.  
  16.   TARGET HOST: 1040ST, COLOR. TESTED as *.TOS PROGRAM
  17.  
  18.   DATE: 7 July 1986
  19.  
  20.   DISCLAIMER: This code carries no warranty, expressed or implied. It is
  21.               placed in the PUBLIC DOMAIN for private use.  Commercial use
  22.               requires the written consent of the author.
  23.  
  24.  }
  25.  
  26. type
  27.       special = packed record
  28.         instr : integer;
  29.         source : long_integer;
  30.         dest  : long_integer;
  31.         retrn : integer;
  32.         resul : long_integer;
  33.       end;
  34.  
  35.       special_ptr = ^special;
  36.  
  37.       convt = record
  38.         case foo : integer of
  39.                 1 : ( i : long_integer );
  40.                 2 : ( p : special_ptr );
  41.         end;
  42.  
  43.  
  44. var
  45.         n : integer;
  46.         rip : convt;
  47.         fig : special_ptr;
  48.  
  49. procedure superexec(dummy : special_ptr); xbios(38);
  50.  
  51. begin
  52.         new(fig);
  53.         fig^.instr := $23F9; {MOVE.L SOURCE,DEST}
  54.         fig^.source := $4BA; {SOURCE ADDRESS}
  55.         rip.p := fig;
  56.         fig^.dest := rip.i + 12; {DESTINATION := ADDR OF RESULT}
  57.         fig^.retrn := $4E75; {RTS}
  58.         for n := 1 to 100 do begin
  59.             superexec(fig);
  60.             writeln(fig^.resul:10:h,n:10);
  61.         end;
  62.         write('Hit Return');
  63.         readln
  64. end.
  65.  
  66. **************************************************************************************